﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.Text;
using lakethaiClassLibrary;

public partial class controls_leftColumn : System.Web.UI.UserControl
{
    protected string productMenu = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        this.CreateCatalogMenu();
    }
    private void CreateCatalogMenu()
    {
        string lang = HttpContext.Current.Session["lancode"].ToString();
        DataTable dt;
        SqlParameter[] param = { new SqlParameter("lang", lang) };
        dt = myDataBinding.GetData("_productGetListName", param);
        if (dt == null || dt.Rows.Count < 1) return;
        StringBuilder sb = new StringBuilder();
        foreach (DataRow row in dt.Rows)
        {
            sb.Append("<li>");
            sb.Append("<a href=\"../P" + row[0].ToString() + "/"
                + myHelp.createURLString(row[1].ToString()) + ".aspx\">");
            sb.Append(row[1].ToString() + "</a>");
            sb.Append("</li>");
        }
        productMenu = sb.ToString();
    }
}
